<template>
  <h1>父组件: {{ money }}</h1>
  <child-a />
</template>
<script>
import { ref, provide } from 'vue'
import ChildA from './components/child-a.vue'
export default {
 name: 'App',
  setup () {
    let money = ref(10000)
    const setMoney = newMoney => {
      money.value = newMoney
    }
    provide('money', money)
    provide('setMoney', setMoney)
    return {
      money
    }
  },
  components: {
    ChildA
  }
}
</script>